package com.realestate.services;

import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.realestate.constants.ComTxManagerName;
import com.realestate.dao.ProductQueryDao;
import com.realestate.model.BrtbProduct;

@Service
public class ProductQueryServiceImpl implements ProductQueryService {

	private static final Logger logger = Logger.getLogger(ProductQueryServiceImpl.class);

	@Autowired
	private ProductQueryDao productQueryDao;

	@Override
	@Transactional(value = ComTxManagerName.COM_TRANSACTION_MANAGER)
	public List<BrtbProduct> getListproductByCategoryCode(String categoryCode, Long limit) {
		return productQueryDao.getListproductByCategoryCode(categoryCode, limit);
	}

	@Override
	@Transactional(value = ComTxManagerName.COM_TRANSACTION_MANAGER)
	public List<BrtbProduct> getListproductByCategoryCode(String categoryCode, Map<String, String> filter, Long limit) {
		return productQueryDao.getListproductByCategoryCode(categoryCode, filter, limit);
	}
}
